package com.edu.compile.dto.nodejs;

import com.alibaba.fastjson.JSON;
import com.edu.compile.dto.RequestParam;

import java.util.List;

public class NodeJsParam extends RequestParam<NodeJsParam> {

    /**
     * 0:空白模板，1：设备接入
     */
    private Integer jsType;

    /**
     * 设备接入时必填
     */
    private Integer productId;

    /**
     * 设备接入时必填
     * 0是事件上报
     * 1是属性上报
     */
    private Integer eventType;

    private String js;

    private List<String> dependency;

    public String getJs() {
        return js;
    }

    public void setJs(String js) {
        this.js = js;
    }

    public List<String> getDependency() {
        return dependency;
    }

    public void setDependency(List<String> dependency) {
        this.dependency = dependency;
    }

    public Integer getJsType() {
        return jsType;
    }

    public void setJsType(Integer jsType) {
        this.jsType = jsType;
    }

    public Integer getProductId() {
        return productId;
    }

    public void setProductId(Integer productId) {
        this.productId = productId;
    }

    public Integer getEventType() {
        return eventType;
    }

    public void setEventType(Integer eventType) {
        this.eventType = eventType;
    }

    @Override
    public NodeJsParam parse(String requestParam) {
        return JSON.parseObject(requestParam, NodeJsParam.class);
    }
}
